home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / Ang261Lib.lha / src / constant.h < prev    next >
C/C++ Source or Header  |  1994-10-22  |  34KB  |  964 lines

  1.  /* constants.h: global constants used by Angband
  2.  
  3.    Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
  4.  
  5.    This software may be copied and distributed for educational, research, and
  6.    not for profit purposes provided that this copyright and statement are
  7.    included in all such copies. */
  8.  
  9. /* Note to the Wizard:
  10.  *
  11.  *       Tweaking these constants can *GREATLY* change the game.
  12.  *       Two years of constant tuning have generated these      
  13.  *       values.  Minor adjustments are encouraged, but you must
  14.  *       be very careful not to unbalance the game.  Moria was  
  15.  *       meant to be challenging, not a give away.  Many        
  16.  *       adjustments can cause the game to act strangely, or even
  17.  *       cause errors.
  18.  */
  19.  
  20. /* Addendum:
  21.  * 
  22.  * I have greatly expanded the number of defined constants.  However, if
  23.  * you change anything below, without understanding EXACTLY how the game
  24.  * uses the number, the program may stop working correctly.  Modify the
  25.  * constants at your own risk.
  26.  */
  27.  
  28. /* Current version number of Angband: 2.6.1
  29.  *
  30.  * Note that 5.2 must never be used, as it was used in Angband 2.4-2.5.
  31.  */
  32.  
  33. #define CUR_VERSION_MAJ 2
  34. #define CUR_VERSION_MIN 6
  35. #define PATCH_LEVEL 1
  36.  
  37. /* Basics */
  38.  
  39. #ifndef FUZZY
  40. #define FUZZY 2
  41. #endif
  42. #ifndef TRUE
  43. #define TRUE 1
  44. #endif
  45. #ifndef FALSE
  46. #define FALSE 0
  47. #endif
  48.  
  49. #define MAX_UCHAR       255
  50. #define MAX_SHORT       32767           /* maximum short/long signed ints */
  51. #define MAX_LONG        0xFFFFFFFFL
  52.  
  53. #ifndef MAXHOSTNAMELEN                    /* may not be defined -b. eck */
  54. #define MAXHOSTNAMELEN  64
  55. #endif
  56.  
  57. /* Changing values below this line may be hazardous to your health! */
  58.  
  59. /* message line location */
  60. #define MSG_LINE  0
  61.  
  62. /* number of messages to save in a buffer */
  63. #define MAX_SAVE_MSG   22               /* How many messages to save -CJS- */
  64. #define MAX_SAVE_HISCORES 500
  65. /* How many hiscores to be saved */
  66.  
  67. /* Dungeon size parameters                                      */
  68. #define MAX_HEIGHT  66                  /* Multiple of 11; >= 22 */
  69. #define MAX_WIDTH  198                  /* Multiple of 33; >= 66 */
  70. #define SCREEN_HEIGHT  22
  71. #define SCREEN_WIDTH   66
  72. #define QUART_HEIGHT (SCREEN_HEIGHT / 4)
  73. #define QUART_WIDTH  (SCREEN_WIDTH / 4)
  74.  
  75. /* Dungeon generation values
  76.  *
  77.  * Note: The entire design of dungeon can be changed by only
  78.  * slight adjustments here.
  79.  */
  80.  
  81. #define DUN_TUN_RND       9     /* was 9 1/Chance of Random direction           */
  82. #define DUN_TUN_CHG      70     /* was 70 Chance of changing direction (99 max) */
  83. #define DUN_TUN_CON      15     /* was 15 Chance of extra tunneling             */
  84. #define DUN_ROO_MEA      45     /* was 32 Mean of # of rooms, standard dev2     */
  85. #define DUN_TUN_PEN      25     /* was 25 % chance of room doors                */
  86. #define DUN_TUN_JCT       8     /* was 15 % chance of doors at tunnel junctions */
  87. #define DUN_STR_DEN       5     /* was 5 Density of streamers                   */
  88. #define DUN_STR_RNG       2     /* was 2 Width of streamers                     */
  89. #define DUN_STR_MAG       3     /* was 3 Number of magma streamers              */
  90. #define DUN_STR_MC       90     /* was 90 1/x chance of treasure per magma      */
  91. #define DUN_STR_QUA       2     /* was 2 Number of quartz streamers             */
  92. #define DUN_STR_QC       40     /* was 40 1/x chance of treasure per quartz     */
  93. #define DUN_UNUSUAL      200    /* was 300 Level/x chance of unusual room       */
  94.  
  95. /* Special level constants - DGK */
  96.  
  97. #define DUN_DEST         15     /* 1/x chance of having a destroyed level */
  98. #define SPEC_DEST        2
  99.  
  100.  
  101. /* Store constants                                              */
  102. #define MAX_OWNERS       24     /* Number of owners to choose from       */
  103. #define MAX_STORES        8     /* Number of different stores            */
  104. #define STORE_INVEN_MAX  24     /* Max number of discrete objs in inven  */
  105. #define STORE_CHOICES    30     /* NUMBER of items to choose stock from  */
  106. #define STORE_MAX_INVEN  18     /* Max diff objs in stock for auto buy   */
  107. #define STORE_MIN_INVEN  10     /* Min diff objs in stock for auto sell  */
  108. #define STORE_TURN_AROUND 9     /* Amount of buying and selling normally */
  109. #define COST_ADJ         100    /* Adjust prices for buying and selling  */
  110.  
  111. #define MAX_QUESTS        4     /* only 1 defined anyway --CFT */
  112. #define DEFINED_QUESTS    1 
  113. #define SAURON_QUEST      0 
  114. #define Q_PLANE          -1
  115.  
  116. /* Treasure constants                                           */
  117. #define INVEN_ARRAY_SIZE 34     /* Size of inventory array(Do not change) */
  118. #define MAX_OBJ_LEVEL   255     /* Maximum level of magic in dungeon      */
  119. #define OBJ_GREAT        11     /* 1/n Chance of item being a Great Item  */
  120.  
  121. /* Number of dungeon objects */
  122. #define MAX_DUNGEON_OBJ  423
  123.  
  124. /* Note that the following constants are all related, if you change one,
  125.  * you must also change all succeeding ones.  Also, player_init[] and
  126.  * store_choice[] may also have to be changed.
  127.  */
  128.  
  129. #define OBJ_OPEN_DOOR           (MAX_DUNGEON_OBJ+23)
  130. #define OBJ_CLOSED_DOOR         (MAX_DUNGEON_OBJ+24)
  131. #define OBJ_SECRET_DOOR         (MAX_DUNGEON_OBJ+25)
  132. #define OBJ_UP_STAIR            (MAX_DUNGEON_OBJ+26)
  133. #define OBJ_DOWN_STAIR          (MAX_DUNGEON_OBJ+27)
  134. #define OBJ_STORE_DOOR          (MAX_DUNGEON_OBJ+28)
  135. #define OBJ_TRAP_LIST           (MAX_DUNGEON_OBJ+36)
  136. #define OBJ_RUBBLE              (MAX_DUNGEON_OBJ+54)
  137. #define OBJ_MUSH                (MAX_DUNGEON_OBJ+55)
  138. #define OBJ_SCARE_MON           (MAX_DUNGEON_OBJ+56)
  139. #define OBJ_GOLD_LIST           (MAX_DUNGEON_OBJ+57)
  140. #define OBJ_NOTHING             (MAX_DUNGEON_OBJ+75)
  141. #define OBJ_RUINED_CHEST        (MAX_DUNGEON_OBJ+76)
  142. #define OBJ_WIZARD              (MAX_DUNGEON_OBJ+77)
  143. /*Special start for rings amulets etc... */
  144. #define SPECIAL_OBJ             (MAX_DUNGEON_OBJ+79)
  145.   /* Number of objects for universe*/
  146. #define MAX_OBJECTS                (MAX_DUNGEON_OBJ+90)
  147.  
  148.  
  149. /* was 7*64, see object_offset() in desc.c, could be MAX_OBJECTS o_o() rewritten
  150.  * now 8*64 beacuse of Rods
  151.  */
  152.  
  153. #define OBJECT_IDENT_SIZE 1024
  154.  
  155. #define MAX_GOLD       18       /* Number of different types of gold     */
  156.  
  157.  
  158. /* with MAX_TALLOC 150, it is possible to get compacting objects during
  159.  * level generation, although it is extremely rare
  160.  */
  161.  
  162. #define MAX_TALLOC      400     /* Max objects per level               */
  163. #define MIN_TRIX          1     /* Minimum t_list index used           */
  164. #define TREAS_ROOM_ALLOC  9     /* Amount of objects for rooms         */
  165. #define TREAS_ANY_ALLOC   3     /* Amount of objects for corridors     */
  166. #define TREAS_GOLD_ALLOC  3     /* Amount of gold (and gems)           */
  167.  
  168.  
  169. /* Magic Treasure Generation constants                  
  170.  * Note: Number of special objects, and degree of enchantments
  171.  *       can be adjusted here.
  172.  */
  173.  
  174. #define OBJ_STD_ADJ     125     /* Adjust STD per level * 100        */
  175. #define OBJ_STD_MIN       7     /* Minimum STD                       */
  176. #define OBJ_TOWN_LEVEL    5     /* Town object generation level      */
  177. #define OBJ_BASE_MAGIC   15     /* Base amount of magic              */
  178. #define OBJ_BASE_MAX     70     /* Max amount of magic               */
  179. #define OBJ_DIV_SPECIAL   4     /* magic_chance/# special magic      */
  180. #define OBJ_DIV_CURSED   13     /* 10*magic_chance/# cursed items    */
  181.  
  182. /* Constants describing limits of certain objects */
  183. #define OBJ_LAMP_MAX    15000   /* Maximum amount that lamp can be filled  */
  184. #define OBJ_BOLT_RANGE     18   /* Maximum range of bolts and balls        */
  185. #define OBJ_RUNE_PROT     550   /* Rune of protection resistance           */
  186.  
  187. /* Creature constants*/
  188. #define MAX_CREATURES     549   /* Number of creatures defined for univ  */
  189. #define N_MONS_ATTS       285   /* Number of monster attack types.       */
  190.  
  191. /* with MAX_MALLOC 101, it is possible to get compacting monsters messages
  192.  * while breeding/cloning monsters
  193.  */
  194.  
  195. #define MAX_MALLOC        600   /* Max that can be allocated                */
  196. #define MAX_MALLOC_CHANCE 160   /* 1/x chance of new monster each round     */
  197. #define MAX_MONS_LEVEL     99   /* Maximum level of creatures               */
  198. #define MAX_SIGHT          20   /* Maximum dis a creature can be seen       */
  199. #define MAX_SPELL_DIS      18   /* Maximum dis creat. spell can be cast     */
  200. #define MAX_MON_MULT       75   /* Maximum reproductions on a level         */
  201. #define MON_MULT_ADJ        8   /* High value slows multiplication          */
  202. #define MON_NASTY          50   /* 1/x chance of high level creat           */
  203. #define MIN_MALLOC_LEVEL   14   /* Minimum number of monsters/level         */
  204. #define MIN_MALLOC_TD       4   /* Number of people on town level (day)     */
  205. #define MIN_MALLOC_TN       8   /* Number of people on town level (night)   */
  206. #define WIN_MON_TOT         2   /* Total number of "win" creatures          */
  207. #define WIN_MON_APPEAR    100   /* Level where winning creatures begin      */
  208. #define MON_SUMMON_ADJ      2   /* Adjust level of summoned creatures       */
  209. #define MON_DRAIN_LIFE      2   /* Percent of player exp drained per hit    */
  210. #define MAX_MON_NATTACK     4   /* Max num attacks (used in mons memory)    */
  211. #define MIN_MONIX           2   /* Minimum index in m_list (1=py, 0=no mon) */
  212.  
  213. /* Trap constants                                               */
  214. #define MAX_TRAP           18   /* Number of defined traps      */
  215.  
  216. /* Descriptive constants                                        */
  217. #define MAX_COLORS     57       /* Used with potions      */
  218. #define MAX_MUSH       21       /* Used with mushrooms    */
  219. #define MAX_WOODS      32       /* Used with staffs       */
  220. #define MAX_METALS     32       /* Used with wands & rods */
  221. #define MAX_ROCKS      42       /* Used with rings        */
  222. #define MAX_AMULETS    16       /* Used with amulets      */
  223. #define MAX_TITLES     45       /* Used with scrolls      */
  224. #define MAX_SYLLABLES  158      /* Used with scrolls      */
  225.  
  226. /* Player constants                                             */
  227. #define MAX_PLAYER_LEVEL    50  /* Maximum possible character level        */
  228. #define MAX_EXP      99999999L  /* Maximum amount of experience -CJS-      */
  229. #define MAX_RACES           10  /* Number of defined races                 */
  230. #define MAX_CLASS            6  /* Number of defined classes               */
  231. #define USE_DEVICE           3  /* x> Harder devices x< Easier devices     */
  232. #define MAX_BACKGROUND     128  /* Number of types of histories for univ   */
  233. #define PLAYER_FOOD_FULL 10000  /* Getting full                            */
  234. #define PLAYER_FOOD_MAX  15000  /* Maximum food value, beyond is wasted    */
  235. #define PLAYER_FOOD_FAINT  300  /* Character begins fainting               */
  236. #define PLAYER_FOOD_WEAK  1000  /* Warn player that he is getting very low */
  237. #define PLAYER_FOOD_ALERT 2000  /* Warn player that he is getting low      */
  238. #define PLAYER_REGEN_FAINT  33  /* Regen factor*2^16 when fainting         */
  239. #define PLAYER_REGEN_WEAK   98  /* Regen factor*2^16 when weak             */
  240. #define PLAYER_REGEN_NORMAL 197 /* Regen factor*2^16 when full             */
  241. #define PLAYER_REGEN_HPBASE 1442 /* Min amount hp regen*2^16               */
  242. #define PLAYER_REGEN_MNBASE 524 /* Min amount mana regen*2^16              */
  243. #define PLAYER_WEIGHT_CAP  130  /* "#"*(1/10 pounds) per strength point    */
  244. #define PLAYER_EXIT_PAUSE    1  /* Pause time before player can re-roll    */
  245.                                 
  246. /* class level adjustment constants */
  247. #define CLA_BTH         0
  248. #define CLA_BTHB        1
  249. #define CLA_DEVICE      2
  250. #define CLA_DISARM      3
  251. #define CLA_SAVE        4
  252.  
  253. /* this depends on the fact that CLA_SAVE values are all the same, if not,
  254.  * then should add a separate column for this
  255.  */
  256. #define CLA_MISC_HIT    4
  257. #define MAX_LEV_ADJ     5
  258.  
  259. /* Base to hit constants                                        */
  260. #define BTH_PLUS_ADJ    3       /* Adjust BTH per plus-to-hit   */
  261.  
  262. /* magic numbers for players inventory array */
  263. #define INVEN_WIELD        22        /* must be first item in equipment list */
  264. #define INVEN_HEAD      23
  265. #define INVEN_NECK      24
  266. #define INVEN_BODY      25
  267. #define INVEN_ARM       26
  268. #define INVEN_HANDS     27
  269. #define INVEN_RIGHT     28
  270. #define INVEN_LEFT      29
  271. #define INVEN_FEET      30
  272. #define INVEN_OUTER     31
  273. #define INVEN_LIGHT     32
  274. #define INVEN_AUX       33
  275.  
  276. /* Attribute indexes -CJS- */
  277.  
  278. #define A_STR    0
  279. #define A_INT    1
  280. #define A_WIS    2
  281. #define A_DEX    3
  282. #define A_CON    4
  283. #define A_CHR    5
  284.  
  285. /* some systems have a non-ANSI definition of this, so undef it first */
  286. #undef CTRL
  287. #define CTRL(c) ((c)&037)
  288. #define DELETE          0x7f
  289. #define ESCAPE        '\033'    /* ESCAPE character -CJS- */
  290.  
  291. #ifndef NULL
  292.  
  293. #ifdef __STDC__
  294. #define NULL ((void *)0)
  295. #else
  296. #define NULL (char *)0
  297. #endif /* __STDC__ */
  298.  
  299. #endif /* NULL */
  300.  
  301.  
  302. /* Fval definitions: these describe the various types of dungeon floors and
  303.  * walls, if numbers above 15 are ever used, then the test against
  304.  * MIN_CAVE_WALL will have to be changed, also the save routines will have
  305.  * to be changed.
  306.  */
  307.  
  308. #define NULL_WALL       0
  309. #define DARK_FLOOR      1
  310. #define LIGHT_FLOOR     2
  311. #define NT_DARK_FLOOR   3
  312. #define NT_LIGHT_FLOOR  4
  313. #define MAX_CAVE_ROOM   4
  314. #define CORR_FLOOR      5
  315. #define BLOCKED_FLOOR   6       /* a corridor space with cl/st/se door or rubble */
  316. #define MAX_CAVE_FLOOR  6
  317.  
  318. #define MAX_OPEN_SPACE  5
  319. #define MIN_CLOSED_SPACE 6
  320.  
  321. #define TMP1_WALL       8
  322. #define TMP2_WALL       9
  323.  
  324. #define MIN_CAVE_WALL   12
  325. #define GRANITE_WALL    12
  326. #define MAGMA_WALL      13
  327. #define QUARTZ_WALL     14
  328. #define BOUNDARY_WALL   15
  329.  
  330. /* Column for stats    */
  331. #define STAT_COLUMN     0
  332.  
  333. /* Class spell types */
  334. #define NONE            0
  335. #define MAGE            1
  336. #define PRIEST          2
  337.  
  338. /* offsets to spell names in spell_names[] array */
  339. #define SPELL_OFFSET    0
  340. #define PRAYER_OFFSET   63
  341.  
  342. /* definitions for the psuedo-normal distribution generation */
  343. #define NORMAL_TABLE_SIZE       256
  344. #define NORMAL_TABLE_SD         64  /* the standard deviation for the table */
  345.  
  346. /* definitions for the player's status field */
  347. #define PY_HUNGRY       0x00000001L
  348. #define PY_WEAK         0x00000002L
  349. #define PY_BLIND        0x00000004L
  350. #define PY_CONFUSED     0x00000008L
  351. #define PY_FEAR         0x00000010L
  352. #define PY_POISONED     0x00000020L
  353. #define PY_FAST         0x00000040L
  354. #define PY_SLOW         0x00000080L
  355. #define PY_SEARCH       0x00000100L
  356. #define PY_REST         0x00000200L
  357. #define PY_STUDY        0x00000400L
  358.  
  359. #define PY_INVULN       0x00001000L
  360. #define PY_HERO         0x00002000L
  361. #define PY_SHERO        0x00004000L
  362. #define PY_BLESSED      0x00008000L
  363. #define PY_DET_INV      0x00010000L
  364. #define PY_TIM_INFRA    0x00020000L
  365. #define PY_SPEED        0x00040000L
  366. #define PY_STR_WGT      0x00080000L
  367. #define PY_PARALYSED    0x00100000L
  368. #define PY_REPEAT       0x00200000L
  369. #define PY_ARMOR        0x00400000L
  370.  
  371. #define PY_STATS        0x3F000000L
  372. #define PY_STR          0x01000000L /* these 6 stat flags must be adjacent */
  373. #define PY_INT          0x02000000L
  374. #define PY_WIS          0x04000000L
  375. #define PY_DEX          0x08000000L
  376. #define PY_CON          0x10000000L
  377. #define PY_CHR          0x20000000L
  378.  
  379. #define PY_HP           0x40000000L
  380. #define PY_MANA         0x80000000L
  381.  
  382. /* definitions for objects that can be worn */
  383. #define TR_STATS        0x0000003FL /* the stats must be the low 6 bits */
  384. #define TR_STR          0x00000001L
  385. #define TR_INT          0x00000002L
  386. #define TR_WIS          0x00000004L
  387. #define TR_DEX          0x00000008L
  388. #define TR_CON          0x00000010L
  389. #define TR_CHR          0x00000020L
  390. #define TR_SEARCH       0x00000040L
  391. #define TR_SLOW_DIGEST  0x00000080L
  392. #define TR_STEALTH      0x00000100L
  393. #define TR_AGGRAVATE    0x00000200L
  394. #define TR_TELEPORT     0x00000400L
  395. #define TR_REGEN        0x00000800L
  396. #define TR_SPEED        0x00001000L
  397.  
  398. #define TR_EGO_WEAPON   0x0007E000L
  399. #define TR_SLAY_DRAGON  0x00002000L
  400. #define TR_SLAY_ANIMAL  0x00004000L
  401. #define TR_SLAY_EVIL    0x00008000L
  402. #define TR_SLAY_UNDEAD  0x00010000L
  403. #define TR_FROST_BRAND  0x00020000L
  404. #define TR_FLAME_TONGUE 0x00040000L
  405.  
  406. #define TR_RES_FIRE     0x00080000L
  407. #define TR_RES_ACID     0x00100000L
  408. #define TR_RES_COLD     0x00200000L
  409. #define TR_SUST_STAT    0x00400000L
  410. #define TR_FREE_ACT     0x00800000L
  411. #define TR_SEE_INVIS    0x01000000L
  412. #define TR_RES_LIGHT    0x02000000L
  413. #define TR_FFALL        0x04000000L
  414. #define TR_SLAY_X_DRAGON        0x08000000L
  415. #define TR_POISON       0x10000000L
  416. #define TR_TUNNEL       0x20000000L
  417. #define TR_INFRA        0x40000000L
  418. #define TR_CURSED       0x80000000L
  419.  
  420. /* flags for flags2 */
  421. #define TR_SLAY_DEMON   0x00000001L
  422. #define TR_SLAY_TROLL   0x00000002L
  423. #define TR_SLAY_GIANT   0x00000004L
  424. #define TR_HOLD_LIFE    0x00000008L
  425. #define TR_SLAY_ORC     0x00000010L
  426. #define TR_TELEPATHY    0x00000020L
  427. #define TR_IM_FIRE      0x00000040L
  428. #define TR_IM_COLD      0x00000080L
  429. #define TR_IM_ACID      0x00000100L
  430. #define TR_IM_LIGHT     0x00000200L
  431. #define TR_LIGHT        0x00000400L
  432. #define TR_ACTIVATE     0x00000800L
  433. #define TR_LIGHTNING    0x00001000L
  434. #define TR_IMPACT       0x00002000L
  435. #define TR_IM_POISON    0x00004000L
  436. #define TR_RES_CONF     0x00008000L
  437. #define TR_RES_SOUND    0x00010000L
  438. #define TR_RES_LT       0x00020000L
  439. #define TR_RES_DARK     0x00040000L
  440. #define TR_RES_CHAOS    0x00080000L
  441. #define TR_RES_DISENCHANT       0x00100000L
  442. #define TR_RES_SHARDS   0x00200000L
  443. #define TR_RES_NEXUS    0x00400000L
  444. #define TR_RES_BLIND    0x00800000L
  445. #define TR_RES_NETHER   0x01000000L
  446. #define TR_ARTIFACT     0x02000000L /* means "is an artifact" -CFT */
  447. #define TR_BLESS_BLADE  0x04000000L /* priests use w/o penalty -DGK*/
  448. #define TR_ATTACK_SPD   0x08000000L /* extra attacks/round -DGK */
  449. #define TR_RES_FEAR     0x10000000L
  450.  
  451. /* definitions for chests */
  452. #define CH_LOCKED       0x00000001L
  453. #define CH_TRAPPED      0x000001F0L
  454. #define CH_LOSE_STR     0x00000010L
  455. #define CH_POISON       0x00000020L
  456. #define CH_PARALYSED    0x00000040L
  457. #define CH_EXPLODE      0x00000080L
  458. #define CH_SUMMON       0x00000100L
  459.  
  460. /* definitions for creatures, cmove field */
  461. #define CM_ALL_MV_FLAGS 0x0000001FL
  462. #define CM_ATTACK_ONLY  0x00000001L
  463. #define CM_MOVE_NORMAL  0x00000002L
  464.  
  465. #define CM_RANDOM_MOVE  0x0000001CL
  466. #define CM_20_RANDOM    0x00000004L
  467. #define CM_40_RANDOM    0x00000008L
  468. #define CM_75_RANDOM    0x00000010L
  469.  
  470. #define CM_SPECIAL      0x003F0000L
  471. #define CM_INVISIBLE    0x00010000L
  472. #define CM_OPEN_DOOR    0x00020000L
  473. #define CM_PHASE        0x00040000L
  474. #define CM_EATS_OTHER   0x00080000L
  475. #define CM_PICKS_UP     0x00100000L
  476. #define CM_MULTIPLY     0x00200000L
  477.  
  478. #define CM_CARRY_OBJ    0x01000000L
  479. #define CM_CARRY_GOLD   0x02000000L
  480. #define CM_TREASURE     0x7C000000L
  481. #define CM_TR_SHIFT     26              /* used for recall of treasure */
  482. #define CM_60_RANDOM    0x04000000L
  483. #define CM_90_RANDOM    0x08000000L
  484. #define CM_1D2_OBJ      0x10000000L
  485. #define CM_2D2_OBJ      0x20000000L
  486. #define CM_4D2_OBJ      0x40000000L
  487. #define CM_WIN          0x80000000L
  488.  
  489. /* creature spell definitions */
  490. #define CS_FREQ         0x0000000FL
  491. #define CS_SPELLS       0xFF07FFF0L
  492. #define CS_TEL_SHORT    0x00000010L
  493. #define CS_TEL_LONG     0x00000020L
  494. #define CS_TEL_TO       0x00000040L
  495. #define CS_LGHT_WND     0x00000080L
  496. #define CS_SER_WND      0x00000100L
  497. #define CS_HOLD_PER     0x00000200L
  498. #define CS_BLIND        0x00000400L
  499. #define CS_CONFUSE      0x00000800L
  500. #define CS_FEAR         0x00001000L
  501. #define CS_SUMMON_MON   0x00002000L
  502. #define CS_SUMMON_UND   0x00004000L
  503. #define CS_SLOW_PER     0x00008000L
  504. #define CS_DRAIN_MANA   0x00010000L
  505.  
  506. #define CS_INT1         0x0006FC30L     /* was 0x80060020L -DGK */
  507. #define CS_INT2         0x71027200L     /* was 0x51023400L -DGK */
  508. #define CS_INT3         0x0000F900L     /* was 0x00000000L -DGK */
  509. #define CS_BREATHE      0x00F80000L
  510. #define CS_BREATHE2     0x8000003FL
  511. #define CS_BREATHE3     0x0000007FL
  512. #define CS_BR_LIGHT     0x00080000L
  513. #define CS_BR_GAS       0x00100000L
  514. #define CS_BR_ACID      0x00200000L
  515. #define CS_BR_FROST     0x00400000L
  516. #define CS_BR_FIRE      0x00800000L
  517.  
  518. /* creature defense flags */
  519. #define CD_DRAGON       0x0001
  520. #define CD_ANIMAL       0x0002
  521. #define CD_EVIL         0x0004
  522. #define CD_UNDEAD       0x0008
  523. #define CD_WEAKNESS     0x03F0
  524. #define CD_FROST        0x0010
  525. #define CD_FIRE         0x0020
  526. #define CD_POISON       0x0040
  527. #define CD_ACID         0x0080
  528. #define CD_LIGHT        0x0100
  529. #define CD_STONE        0x0200
  530.  
  531. #define CD_NO_SLEEP     0x1000
  532. #define CD_INFRA        0x2000
  533. #define CD_MAX_HP       0x4000
  534. #define CD_ORC          0x8000
  535.  
  536.  
  537. /* inventory stacking subvals
  538.  * these never stack:
  539.  */
  540.  
  541. #define ITEM_NEVER_STACK_MIN    0
  542. #define ITEM_NEVER_STACK_MAX    63
  543.  
  544. /* these items always stack with others of same subval, always treated as
  545.  * single objects, must be power of 2
  546.  */
  547.  
  548. #define ITEM_SINGLE_STACK_MIN   64
  549. #define ITEM_SINGLE_STACK_MAX   192     /* see NOTE below */
  550.  
  551.  
  552. /* these items stack with others only if have same subval and same p1,
  553.  * they are treated as a group for wielding, etc.
  554.  */
  555.  
  556. #define ITEM_GROUP_MIN          192
  557. #define ITEM_GROUP_MAX          255
  558.  
  559. /* NOTE: items with subval 192 are treated as single objects, but only stack
  560.  * with others of same subval if have the same p1 value, only used for
  561.  * torches
  562.  */
  563.  
  564.  
  565. /* id's used for object description, stored in object_ident */
  566. #define OD_TRIED        0x1
  567. #define OD_KNOWN1       0x2
  568.  
  569. /* id's used for item description, stored in i_ptr->ident */
  570. #define ID_MAGIK        0x1
  571. #define ID_DAMD         0x2
  572. #define ID_EMPTY        0x4
  573. #define ID_KNOWN2       0x8
  574. #define ID_STOREBOUGHT  0x10
  575. #define ID_SHOW_HITDAM  0x20
  576. #define ID_NOSHOW_P1    0x40    /* don't show (+x) even if p1 != 0 -CWS   */
  577. #define ID_NOSHOW_TYPE  0x80    /* don't show (+x of yyy), just (+x) -CWS */
  578.  
  579. /* indexes into the special name table */
  580. #define SN_NULL                 0
  581. #define SN_R                    1
  582. #define SN_RA                   2
  583. #define SN_RF                   3
  584. #define SN_RC                   4
  585. #define SN_RL                   5
  586. #define SN_HA                   6
  587. #define SN_DF                   7
  588. #define SN_SA                   8
  589. #define SN_SD                   9
  590. #define SN_SE                   10
  591. #define SN_SU                   11
  592. #define SN_FT                   12
  593. #define SN_FB                   13
  594. #define SN_FREE_ACTION          14
  595. #define SN_SLAYING              15
  596. #define SN_CLUMSINESS           16
  597. #define SN_WEAKNESS             17
  598. #define SN_SLOW_DESCENT         18
  599. #define SN_SPEED                19
  600. #define SN_STEALTH              20
  601. #define SN_SLOWNESS             21
  602. #define SN_NOISE                22
  603. #define SN_GREAT_MASS           23
  604. #define SN_INTELLIGENCE         24
  605. #define SN_WISDOM               25
  606. #define SN_INFRAVISION          26
  607. #define SN_MIGHT                27
  608. #define SN_LORDLINESS           28
  609. #define SN_MAGI                 29
  610. #define SN_BEAUTY               30
  611. #define SN_SEEING               31
  612. #define SN_REGENERATION         32
  613. #define SN_STUPIDITY            33
  614. #define SN_DULLNESS             34
  615. #define SN_BLINDNESS            35
  616. #define SN_TIMIDNESS            36
  617. #define SN_TELEPORTATION        37
  618. #define SN_UGLINESS             38
  619. #define SN_PROTECTION           39
  620. #define SN_IRRITATION           40
  621. #define SN_VULNERABILITY        41
  622. #define SN_ENVELOPING           42
  623. #define SN_FIRE                 43
  624. #define SN_SLAY_EVIL            44
  625. #define SN_DRAGON_SLAYING       45
  626. #define SN_EMPTY                46
  627. #define SN_LOCKED               47
  628. #define SN_POISON_NEEDLE        48
  629. #define SN_GAS_TRAP             49
  630. #define SN_EXPLOSION_DEVICE     50
  631. #define SN_SUMMONING_RUNES      51
  632. #define SN_MULTIPLE_TRAPS       52
  633. #define SN_DISARMED             53
  634. #define SN_UNLOCKED             54
  635. #define SN_SLAY_ANIMAL          55
  636. #define SN_GROND                56
  637. #define SN_RINGIL               57
  638. #define SN_AEGLOS               58
  639. #define SN_ARUNRUTH             59
  640. #define SN_MORMEGIL             60
  641. #define SN_MORGUL               61
  642. #define SN_ANGRIST              62
  643. #define SN_GURTHANG             63
  644. #define SN_CALRIS               64
  645. #define SN_ACCURACY             65
  646. #define SN_ANDURIL              66
  647. #define SN_SO                   67
  648. #define SN_POWER                68
  649. #define SN_DURIN                69
  650. #define SN_AULE                 70
  651. #define SN_WEST                 71
  652. #define SN_BLESS_BLADE          72
  653. #define SN_SDEM                 73
  654. #define SN_ST                   74
  655. #define SN_BLOODSPIKE           75
  656. #define SN_THUNDERFIST          76
  657. #define SN_WOUNDING             77
  658. #define SN_ORCRIST              78
  659. #define SN_GLAMDRING            79
  660. #define SN_STING                80
  661. #define SN_LIGHT                81
  662. #define SN_AGILITY              82
  663. #define SN_BACKBITING           83
  664. #define SN_DOOMCALLER           84
  665. #define SN_SG                   85
  666. #define SN_TELEPATHY            86
  667. #define SN_DRAGONKIND           87
  668. #define SN_NENYA                88
  669. #define SN_NARYA                89
  670. #define SN_VILYA                90
  671. #define SN_AMAN                 91
  672. #define SN_BELEGENNON           92
  673. #define SN_FEANOR               93
  674. #define SN_ANARION              94
  675. #define SN_ISILDUR              95
  676. #define SN_FINGOLFIN            96
  677. #define SN_ELVENKIND            97
  678. #define SN_SOULKEEPER           98
  679. #define SN_DOR_LOMIN            99
  680. #define SN_MORGOTH             100
  681. #define SN_BELEG               101
  682. #define SN_DAL                 102
  683. #define SN_PAURHACH            103
  684. #define SN_PAURNIMMEN          104
  685. #define SN_PAURAEGEN           105
  686. #define SN_CAMMITHRIM          106
  687. #define SN_CAMBELEG            107
  688. #define SN_HOLHENNETH          108
  689. #define SN_PAURNEN             109
  690. #define SN_AEGLIN              110
  691. #define SN_CAMLOST             111
  692. #define SN_NIMLOTH             112
  693. #define SN_NAR                 113
  694. #define SN_BERUTHIEL           114
  695. #define SN_GORLIM              115
  696. #define SN_NARTHANC            116
  697. #define SN_NIMTHANC            117
  698. #define SN_DETHANC             118
  699. #define SN_GILETTAR            119
  700. #define SN_RILIA               120
  701. #define SN_BELANGIL            121
  702. #define SN_BALLI               122
  703. #define SN_LOTHARANG           123
  704. #define SN_FIRESTAR            124
  705. #define SN_ERIRIL              125
  706. #define SN_CUBRAGOL            126
  707. #define SN_BARD                127
  708. #define SN_COLLUIN             128
  709. #define SN_HOLCOLLETH          129
  710. #define SN_TOTILA              130
  711. #define SN_PAIN                131
  712. #define SN_ELVAGIL             132
  713. #define SN_AGLARANG            133
  714. #define SN_ROHAN               134
  715. #define SN_EORLINGAS           135
  716. #define SN_BARUKKHELED         136
  717. #define SN_WRATH               137
  718. #define SN_HARADEKKET          138
  719. #define SN_MUNDWINE            139
  720. #define SN_GONDRICAM           140
  721. #define SN_ZARCUTHRA           141
  722. #define SN_CARETH              142
  723. #define SN_FORASGIL            143
  724. #define SN_CRISDURIAN          144
  725. #define SN_COLANNON            145
  726. #define SN_HITHLOMIR           146
  727. #define SN_THALKETTOTH         147
  728. #define SN_ARVEDUI             148
  729. #define SN_THRANDUIL           149
  730. #define SN_THENGEL             150
  731. #define SN_HAMMERHAND          151
  732. #define SN_CELEGORM            152
  733. #define SN_THROR               153
  734. #define SN_MAEDHROS            154
  735. #define SN_OLORIN              155
  736. #define SN_ANGUIREL            156
  737. #define SN_THORIN              157
  738. #define SN_CELEBORN            158
  739. #define SN_OROME               159
  740. #define SN_EONWE               160
  741. #define SN_GONDOR              161
  742. #define SN_THEODEN             162
  743. #define SN_THINGOL             163
  744. #define SN_THORONGIL           164
  745. #define SN_LUTHIEN             165
  746. #define SN_TUOR                166
  747. #define SN_ULMO                167
  748. #define SN_OSONDIR             168
  749. #define SN_TURMIL              169
  750. #define SN_CASPANION           170
  751. #define SN_TIL                 171
  752. #define SN_DEATHWREAKER        172
  753. #define SN_AVAVIR              173
  754. #define SN_TARATOL             174
  755. #define SN_RAZORBACK           175
  756. #define SN_BLADETURNER         176
  757. #define SN_SHATTERED           177
  758. #define SN_BLASTED             178
  759. #define SN_ATTACKS             179
  760. #define SN_ARRAY_SIZE          180 /* must be at end of this list */
  761.  
  762.  
  763. /* defines for treasure type values (tval) */
  764.  
  765. #define TV_NEVER        -1 /* used by find_range() for non-search */
  766. #define TV_NOTHING       0
  767. #define TV_MISC          1
  768. #define TV_CHEST         2
  769. #define TV_SPIKE         3
  770.  
  771. /* min tval for wearable items, all items between TV_MIN_WEAR and TV_MAX_WEAR
  772.  * use the same flag bits, see the TR_* defines
  773.  */
  774.  
  775. #define TV_MIN_WEAR     10
  776.  
  777. /* items tested for enchantments, i.e. the MAGIK inscription, see the
  778.  * enchanted() procedure
  779.  */
  780.  
  781. #define TV_MIN_ENCHANT  10
  782. #define TV_SLING_AMMO   10
  783. #define TV_BOLT         11
  784. #define TV_ARROW        12
  785. #define TV_LIGHT        15
  786. #define TV_BOW          20
  787. #define TV_HAFTED       21
  788. #define TV_POLEARM      22
  789. #define TV_SWORD        23
  790. #define TV_DIGGING      25
  791. #define TV_BOOTS        30
  792. #define TV_GLOVES       31
  793. #define TV_CLOAK        32
  794. #define TV_HELM         33
  795. #define TV_SHIELD       34
  796. #define TV_HARD_ARMOR   35
  797. #define TV_SOFT_ARMOR   36
  798. /* max tval that uses the TR_* flags */
  799. #define TV_MAX_ENCHANT  39
  800. #define TV_AMULET       40
  801. #define TV_RING         45
  802. /* max tval for wearable items */
  803. #define TV_MAX_WEAR     50
  804. #define TV_STAFF        55
  805. #define TV_WAND         65
  806. #define TV_ROD          66
  807. #define TV_SCROLL1      70
  808. #define TV_SCROLL2      71
  809. #define TV_POTION1      75
  810. #define TV_POTION2      76
  811. #define TV_FLASK        77
  812. #define TV_FOOD         80
  813. #define TV_MAGIC_BOOK   90
  814. #define TV_PRAYER_BOOK  91
  815. /* objects with tval above this are never picked up by monsters */
  816. #define TV_MAX_OBJECT   99
  817. #define TV_GOLD         100
  818. /* objects with higher tvals can not be picked up */
  819. #define TV_MAX_PICK_UP  100
  820. #define TV_INVIS_TRAP   101
  821. /* objects between TV_MIN_VISIBLE and TV_MAX_VISIBLE are always visible,
  822.    i.e. the cave fm flag is set when they are present */
  823. #define TV_MIN_VISIBLE  102
  824. #define TV_VIS_TRAP     102
  825. #define TV_RUBBLE       103
  826. /* following objects are never deleted when trying to create another one
  827.    during level generation */
  828. #define TV_MIN_DOORS    104
  829. #define TV_OPEN_DOOR    104
  830. #define TV_CLOSED_DOOR  105
  831. #define TV_UP_STAIR     107
  832. #define TV_DOWN_STAIR   108
  833. #define TV_SECRET_DOOR  109
  834. #define TV_STORE_DOOR   110
  835. #define TV_MAX_VISIBLE  110
  836.  
  837. /* spell types used by get_flags(), breathe(), fire_bolt() and fire_ball() */
  838. #define GF_MAGIC_MISSILE 0
  839. #define GF_LIGHTNING    1
  840. #define GF_POISON_GAS   2
  841. #define GF_ACID         3
  842. #define GF_FROST        4
  843. #define GF_FIRE         5
  844. #define GF_HOLY_ORB     6
  845. #define GF_ARROW        7
  846. #define GF_PLASMA       8
  847. #define GF_NETHER       9
  848. #define GF_WATER        10
  849. #define GF_CHAOS        11
  850. #define GF_SHARDS       12
  851. #define GF_SOUND        13
  852. #define GF_CONFUSION    14
  853. #define GF_DISENCHANT   15
  854. #define GF_NEXUS        16
  855. #define GF_FORCE        17
  856. #define GF_INERTIA      18
  857. #define GF_LIGHT        19
  858. #define GF_DARK         20
  859. #define GF_TIME         21
  860. #define GF_GRAVITY      22
  861. #define GF_MANA         23
  862. #define GF_METEOR       24
  863. #define GF_ICE          25
  864.  
  865. #define WD_LT           1L
  866. #define WD_LT_BLTS      2L
  867. #define WD_FT_BLTS      3L
  868. #define WD_FR_BLTS      4L
  869. #define WD_ST_MUD       5L
  870. #define WD_POLY         6L
  871. #define WD_HEAL_MN      7L
  872. #define WD_HAST_MN      8L
  873. #define WD_SLOW_MN      9L
  874. #define WD_CONF_MN      10L
  875. #define WD_SLEE_MN      11L
  876. #define WD_DRAIN        12L
  877. #define WD_TR_DEST      13L
  878. #define WD_MAG_MIS      14L
  879. #define WD_FEAR_MN      15L
  880. #define WD_CLONE        16L
  881. #define WD_TELE         17L
  882. #define WD_DISARM       18L
  883. #define WD_LT_BALL      19L
  884. #define WD_CD_BALL      20L
  885. #define WD_FR_BALL      21L
  886. #define WD_ST_CLD       22L
  887. #define WD_AC_BALL      23L
  888. #define WD_WONDER       24L
  889. #define WD_DRG_FIRE     25L
  890. #define WD_DRG_FRST     26L
  891. #define WD_DRG_BREA     27L
  892. #define WD_AC_BLTS      28L
  893. #define WD_ANHIL        29L
  894.  
  895. #define RD_LT           1L
  896. #define RD_LT_BLTS      2L
  897. #define RD_FT_BLTS      3L
  898. #define RD_FR_BLTS      4L
  899. #define RD_ST_MUD       5L
  900. #define RD_POLY         6L
  901. #define RD_SLOW_MN      7L
  902. #define RD_CONF_MN      8L
  903. #define RD_SLEE_MN      9L
  904. #define RD_DRAIN        10L
  905. #define RD_TR_DEST      11L
  906. #define RD_MAG_MIS      12L
  907. #define RD_TELE         13L
  908. #define RD_DISARM       14L
  909. #define RD_LT_BALL      15L
  910. #define RD_CD_BALL      16L
  911. #define RD_FR_BALL      17L
  912. #define RD_ST_CLD       18L
  913. #define RD_AC_BALL      19L
  914. #define RD_AC_BLTS      20L
  915. #define RD_ANHIL        21L
  916. #define RD_MAPPING      22L
  917. #define RD_IDENT        23L
  918. #define RD_CURE         24L
  919. #define RD_HEAL         25L
  920. #define RD_DETECT       26L
  921. #define RD_RESTORE      27L
  922. #define RD_SPEED        28L
  923. #define RD_ILLUME       29L
  924. #define RD_PROBE        30L
  925. #define RD_RECALL       31L
  926. #define RD_TRAP_LOC     32L
  927. #define RD_MK_WALL      33L
  928.  
  929. #define ST_LIGHT        1L
  930. #define ST_DR_LC        2L
  931. #define ST_TRP_LC       3L
  932. #define ST_TRE_LC       4L
  933. #define ST_OBJ_LC       5L
  934. #define ST_TELE         6L
  935. #define ST_EARTH        7L
  936. #define ST_SUMMON       8L
  937. #define ST_DEST         9L
  938. #define ST_STAR         10L
  939. #define ST_HAST_MN      11L
  940. #define ST_SLOW_MN      12L
  941. #define ST_SLEE_MN      13L
  942. #define ST_CURE_LT      14L
  943. #define ST_DET_INV      15L
  944. #define ST_SPEED        16L
  945. #define ST_SLOW         17L
  946. #define ST_REMOVE       18L
  947. #define ST_DET_EVI      19L
  948. #define ST_CURING       20L
  949. #define ST_DSP_EVI      21L
  950. #define ST_DARK         22L
  951. #define ST_GENOCIDE     23L
  952. #define ST_POWER        24L
  953. #define ST_MAGI         25L
  954. #define ST_HOLYNESS     26L
  955. #define ST_IDENTIFY     27L
  956. #define ST_SURROUND     28L
  957. #define ST_HEALING      29L
  958. #define ST_PROBE        30L
  959.  
  960. /* bit flags used in my revamped enchant() code -CFT */
  961. #define ENCH_TOHIT   1
  962. #define ENCH_TODAM   2
  963. #define ENCH_TOAC    4
  964.